
#ifndef SPI_W25N01GVZEIG_H
#define SPI_W25N01GVZEIG_H

#include "driver/spi_master.h"
#include "driver/gpio.h"
#include "sdkconfig.h"
#ifdef __cplusplus
extern "C"
{
#endif
    void spi_nand_init(void);
    void nand_protect(void);
    void nand_unprotect(void);
    void nand_write_enable(void);
    void nand_Reset(void);
    uint32_t nand_read_JEDEC_ID(void);
    void nand_LUT_set(uint16_t LBA, uint16_t PBA);
    void nand_LUT_read(uint16_t* LBA, uint16_t* PBA);
    int nand_erase_a_block(uint8_t page_addh, uint8_t page_addl);
    uint8_t nand_check_erase_fail_flag(void);
    uint8_t nand_check_program_fail_flag(void);
    uint8_t nand_check_embedded_ECC_flag(void);
    void nand_enable_embedded_ECC(void);
    void nand_disable_embedded_ECC(void);
    uint8_t nand_check_embedded_ECC_enable(void);
    void nand_enable_buffer_mode(void);
    uint8_t nand_check_buffer_mode(void);
    void nand_disable_buffer_mode(void);
    uint8_t nand_read_status_register(uint8_t sr_sel);
    void nand_write_status_register(uint8_t sr_sel, uint8_t wdat);
    int nand_busy_check(void);
    void nand_page_data_read(uint8_t page_addh, uint8_t page_addl);
    void nand_normal_read(uint8_t col_addh, uint8_t col_addl, uint8_t* buff, uint32_t count);
    void nand_continuous_normal_read(uint8_t* buff, uint32_t count);
    void nand_page_program_pattern(uint8_t col_addh, uint8_t col_addl, const  uint8_t* program_buffer, uint32_t count);
    void nand_page_program_random(uint8_t col_addh, uint8_t col_addl, const uint8_t* program_buffer, uint32_t count);
    void nand_program_excute(uint8_t page_addh, uint8_t page_addl);

	
#ifdef __cplusplus
}
#endif

#endif

